#define _CRT_SECURE_NO_WARNINGS 1
#include <stdio.h>
#include <assert.h>

char* my_strncat(char* dest, char* src, int n)
{
	char* ret = dest;
	assert(dest && src);
	while (*dest != '\0')
	{
		dest++;
	}
	int count = 0;
	while (*dest++ = *src++)
	{
		count++;
		if (count == n)
		{
			break;
		}
	}
	return ret;
}

int main()
{
	char arr1[20] = "abc";
	my_strncat(arr1, arr1,2);
	printf("%s\n", arr1);
	return 0;
}